{extend name="apps/common/view/front.tpl" /}
<!-- -->
{block name="header_meta"}
<title>{:config('user.title_account')}－{:config('common.site_name')}</title>
<meta name="keywords" content="{:config('user.keywords_login')}" />
<meta name="description" content="{:config('user.description_account')}" />{/block}
{block name="header_more"}<link href="{:DcUrlCss($domain, $path_root.$path_view.'column.css')}" rel="stylesheet">{/block}
{block name="main"}
<div class="d-flex flex-column justify-content-center h-100">
  <a class="h4 text-light mx-auto mb-4" href="{$path_root}">{:config('common.site_name')}</a>
  <div class="card mx-auto card-width">
    <div class="card-header text-center pt-3">
      <a class="text-purple mr-3" href="javascript:;"><i class="fa fa-fw fa-key"></i>密码登录</a>
      {if userRegisterSms()}<a class="text-muted mr-3" href="{:DcUrl('user/account/index')}"><i class="fa fa-fw fa-sign-in"></i>免密登录</a>{/if}
      {if userRegister()}<a class="text-muted" href="{:DcUrl('user/register/index')}"><i class="fa fa-fw fa-user"></i>注册帐号</a>{/if}
    </div>
    <form class="card-body" action="{:DcUrl('user/login/update')}" method="post" target="_self" data-toggle="form" data-callback="daicuo.user.dialog">
      <input type="hidden" name="callback" value="{$callback}">
      <input type="hidden" name="state" value="{$state}">
      <div class="input-group input-group-sm mb-3">
        <div class="input-group-prepend">
          <span class="input-group-text"><i class="fa fa-fw fa-sign-in"></i></span>
        </div>
        <input type="text" class="form-control" name="user_name" required="true" placeholder="用户名/手机/邮箱">
      </div>
      <div class="input-group input-group-sm mb-3">
        <div class="input-group-prepend">
          <span class="input-group-text"><i class="fa fa-fw fa-lock"></i></span>
        </div>
        <input type="password" class="form-control" name="user_pass" required="true" placeholder="密码">
      </div>
      {if DcBool(config('common.site_captcha'))}
      <div class="input-group input-group-sm mb-3">
        <div class="input-group-prepend">
          <span class="input-group-text"><i class="fa fa-fw fa-key"></i></span>
        </div>
        <input type="text" class="form-control" name="user_captcha" required="true" placeholder="{:lang('user_captcha')}" autocomplete="off">
      </div>
      <p class="mb-3">
        <img class="rounded img-fluid border w-100" id="captcha" src="{$path_root}index.php?s=captcha" alt="{:lang('user_captcha')}" data-toggle="captcha"/>
      </p>
      {/if}
      <p class="card-text small d-flex justify-content-between">
        <span>
          <input type="checkbox" name="user_expire" checked="checked" value="1"> 记住密码
        </span>
        <a class="small mx-1 text-dark text-decoration-none" href="{:DcUrl('user/reset/index')}">
          <i class="fa fa-fw fa-user-o"></i> 找回密码
        </a>
      </p>
      <p class="text-center mb-0">
        <button class="btn btn-purple btn-block" type="submit">{:lang('login')}</button>
      </p>
    </form>
    {if config('user.oauth')}
    <div class="card-footer text-center small">
      {foreach name=":config('user.oauth')" id="oauth"}
      <a href="{:DcUrl($oauth.'/login/index')}">{:lang('login_oauth_'.$oauth)}</a>
      {/foreach}
    </div>
    {/if}
  </div>
</div>
{/block}